﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using MongoDB.Bson.Serialization.Attributes;

namespace BigData.DataContracts.Objects.BigData.BaseTypes
{
    /// <summary>
    /// Represents an object in a collection which has a finite life.
    /// This is useful in instances where you would want to replace the object
    /// in the future or actually do auditing
    /// </summary>
    [DataContract]
    public abstract class BigDataDBObject_FiniteLifetime : BigDataDBObjectBase
    {
        public BigDataDBObject_FiniteLifetime()
        {
            this.RecordStartDate = DateTime.Now;
            this.RecordEndDate = DateTime.MaxValue;
        }
        /// <summary>
        /// The time for which the record starts
        /// </summary>
        [DataMember]
        [BsonDateTimeOptions(Kind = DateTimeKind.Local)]
        public DateTime RecordStartDate { get; set; }
        /// <summary>
        /// The time for which the record ends
        /// </summary>
        [DataMember]
        [BsonDateTimeOptions(Kind = DateTimeKind.Local)]
        public DateTime RecordEndDate { get; set; }
    }
}
